package com.qczl.pme.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * 区域信息
 * 
 * @author SongR
 * 
 */
@Entity
@Table(name="pme_basis_area")
public class PMEArea implements Serializable {

	private static final long serialVersionUID = -4246758834698586677L;
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "area_id")
	private Long id;// 编号
	@Column(name = "area_pid")
	private Long pid;// 父编号
	@Column(name = "area_name")
	private String name;// 名称
	@Column(name = "area_desc")
	private String desc;// 描述
	@Column(name = "area_status")
	private Integer status;// 状态（-1、已删除0、可用1、不可用）
	@Column(name = "area_creattime")
	private Date creattime;// 创建时间
	@Column(name = "area_sort")
	private Long sort;// 排序
	@Column(name = "area_level")
	private Integer level;//0.县级   1.镇级   2村级
	@Column(name = "area_user_id")
	private Long userid;// 创建者编号
	
	@OneToMany(mappedBy = "area", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private Set<PMESTB> stbs;//一个区域有多个机顶盒
	
	@OneToMany(mappedBy = "area", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private Set<PMECamera> cameras;//一个区域有多个摄像头
	
	@OneToMany(mappedBy = "area", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private Set<PMEPerson> persons;//一个区域对应多个人员
	
	@OneToMany(mappedBy = "area", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private Set<PMEDuties> duties;
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getPid() {
		return pid;
	}

	public void setPid(Long pid) {
		this.pid = pid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Date getCreattime() {
		return creattime;
	}

	public void setCreattime(Date creattime) {
		this.creattime = creattime;
	}

	public Long getSort() {
		return sort;
	}

	public void setSort(Long sort) {
		this.sort = sort;
	}

	public Long getUserid() {
		return userid;
	}

	public void setUserid(Long userid) {
		this.userid = userid;
	}

	public Set<PMESTB> getStbs() {
		return stbs;
	}

	public void setStbs(Set<PMESTB> stbs) {
		this.stbs = stbs;
	}

	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	public Set<PMECamera> getCameras() {
		return cameras;
	}

	public void setCameras(Set<PMECamera> cameras) {
		this.cameras = cameras;
	}

	public Set<PMEPerson> getPersons() {
		return persons;
	}

	public void setPersons(Set<PMEPerson> persons) {
		this.persons = persons;
	}

	public Set<PMEDuties> getDuties() {
		return duties;
	}

	public void setDuties(Set<PMEDuties> duties) {
		this.duties = duties;
	}

}
